<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>

    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="海尔卡消费信息汇总">
                    <h:form>
                        <div id="qrytable">
                            <p:growl id="msgs" showDetail="false"/>
                            <p:panel id="balPanel" style="margin-top:10px">
                                <h:panelGrid columns="2">
                                    <h:outputLabel value="开卡总数:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.openCardCnt}"/>
                                    <h:outputLabel value="启用卡数:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.usingCardCnt}"/>

                                    <h:outputLabel value="挂失卡数:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.lossCardCnt}"/>
                                    <h:outputLabel value="冻结卡数:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.frozenCardCnt}"/>
                                    <h:outputLabel value="注销卡数:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.cancelCardCnt}"/>

                                    <h:outputLabel value="启用总金额:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.openCardTotalAmt}"/>
                                    <h:outputLabel value="卡消费总额:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.cardConsumeTotalAmt}"/>

                                    <h:outputLabel value="可消费余额:"/>
                                    <h:outputLabel value="#{shopCardInfoAction.cardTotalBalAmt}"/>
                                </h:panelGrid>
                            </p:panel>
                            <br/>
                            <p:dataTable id="pdt" dynamic="true" style="width:100%;"
                                         value="#{shopCardInfoAction.cardList}" var="record"
                                         rowKey="#{record.pkid}"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                         paginator="true" rows="15" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="没有查询到数据记录...">
                                <p:column headerText="卡号" style="text-align: center">
                                    <h:outputText value="#{record.cardno}"/>
                                </p:column>

                                <p:column headerText="开卡金额">
                                    <h:outputText value="#{record.openamt}" style="float: right">
                                        <f:convertNumber pattern="###,###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="卡状态" style="text-align: center">
                                    <h:outputText
                                            value="#{cdtCardAction.cardStatus.valueOfAlias(record.cardsts).title}"/>
                                </p:column>
                                <p:column headerText="发卡日期" style="text-align: center">
                                    <h:outputText value="#{record.opendate}"/>
                                </p:column>
                                <p:column headerText="有效日期">
                                    <h:outputText value="#{record.valdate}" style="text-align: center"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>